From: kaf24@scramble.cl.cam.ac.uk Date: Wed, 28 Apr 2004 11:47:51 +0000 (+0000) Subject: bitkeeper revision 1.879.1.2 (408f99e7sN48_I90Di8Eqaodd_1KjQ) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~18234^2~4 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=3f83f4a5ab1694cfdd1426193d0bf3fcc73c4c95;p=xen.git bitkeeper revision 1.879.1.2 (408f99e7sN48_I90Di8Eqaodd_1KjQ) A few fixes to new I/O world. --- diff --git a/tools/xend/lib/domain_controller.h b/tools/xend/lib/domain_controller.h index eec8402e5f..d9ea7d6160 100644 --- a/tools/xend/lib/domain_controller.h +++ b/tools/xend/lib/domain_controller.h @@ -258,13 +258,13 @@ typedef struct { } blkif_be_vbd_shrink_t; /* - * CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED: + * CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED: * Notify the domain controller that the back-end driver is DOWN or UP. * If the driver goes DOWN while interfaces are still UP, the domain * will automatically send DOWN notifications. */ typedef struct { unsigned int status; /* BLKIF_DRIVER_STATUS_??? */ -} blkif_be_driver_status_changed; +} blkif_be_driver_status_changed_t; #endif /* __DOMAIN_CONTROLLER_H__ */ diff --git a/tools/xend/lib/main.py b/tools/xend/lib/main.py index 4dd26ca8c5..b870af55d1 100755 --- a/tools/xend/lib/main.py +++ b/tools/xend/lib/main.py @@ -46,11 +46,13 @@ def daemon_loop(): # The DOM0 control interface is not set up via the management interface. # Note that console messages don't come our way (actually, only driver - # back-ends should use the DOM0 control interface). We therefore don't - # need to set up console structures. - xend.utils.port(0) - xend.main.notifier.bind(port.local_port) - xend.main.control_list[port.local_port] = (port, 0, 0, 0) + # back-ends should use the DOM0 control interface) -- the console + # structures are dummies. + dom0_port = xend.utils.port(0) + xend.main.notifier.bind(dom0_port.local_port) + xend.main.control_list[dom0_port.local_port] = \ + (dom0_port, xend.utils.buffer(), xend.utils.buffer(), \ + xend.console.interface(0, dom0_port.local_port)) ## ## MAIN LOOP diff --git a/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/backend/control.c b/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/backend/control.c index e1ed295ed3..2baddcd616 100644 --- a/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/backend/control.c +++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/backend/control.c @@ -56,5 +56,16 @@ static void blkif_ctrlif_rx(ctrl_msg_t *msg, unsigned long id) void blkif_ctrlif_init(void) { + ctrl_msg_t cmsg; + blkif_be_driver_status_changed_t st; + (void)ctrl_if_register_receiver(CMSG_BLKIF_BE, blkif_ctrlif_rx); + + /* Send a driver-UP notification to the domain controller. */ + cmsg.type = CMSG_BLKIF_BE; + cmsg.subtype = CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED; + cmsg.length = sizeof(blkif_be_driver_status_changed_t); + st.status = BLKIF_DRIVER_STATUS_UP; + memcpy(cmsg.msg, &st, sizeof(st)); + ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE); } diff --git a/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/frontend/main.c b/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/frontend/main.c index b0c524f390..2936d78ea2 100644 --- a/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/frontend/main.c +++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/frontend/main.c @@ -670,7 +670,19 @@ static void blkif_ctrlif_rx(ctrl_msg_t *msg, unsigned long id) int __init xlblk_init(void) { + ctrl_msg_t cmsg; + blkif_fe_driver_status_changed_t st; + (void)ctrl_if_register_receiver(CMSG_BLKIF_FE, blkif_ctrlif_rx); + + /* Send a driver-UP notification to the domain controller. */ + cmsg.type = CMSG_BLKIF_FE; + cmsg.subtype = CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED; + cmsg.length = sizeof(blkif_fe_driver_status_changed_t); + st.status = BLKIF_DRIVER_STATUS_UP; + memcpy(cmsg.msg, &st, sizeof(st)); + ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE); + return 0; }